package com.zcs.shardingjdbc.controller;
import com.zcs.shardingjdbc.entity.Dict;
import com.zcs.shardingjdbc.service.DictService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zcs
 */
@RestController
public class DictController {
	
	@Resource
	private DictService dictService;
	
	@GetMapping("/dict/add")
	public Object add() {
		for (long i = 0; i < 10; i++) {
			Dict dict = new Dict();
			dict.setCity("xx");
			dict.setRegion("yy");
			dictService.save(dict);
		}
		return "success";
	}
	
}
